package Dao;
import Model.ArrangeInfo;
import Model.Department;
import Model.ElderInfo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface ArrangeInfoDao {


    int saveimage(ArrangeInfo product);

    List<ArrangeInfo> showimage();
    /**
     * 派工信息页面：接口
     * @return
     */
    List<ArrangeInfo> getAllArrangeInfoList();

    List<ArrangeInfo> getAllShortArrangeInfoList();

    int cleanWeek(String ArrangeID);

    /**
     * 派工日程安排页面：确定服务时间
     * @param id
     * @param status
     */
    int updateOverTime(@Param(value = "id") int id,@Param(value = "status") String status);

    /**
     * 派工日程安排页面：确定服务时间
     * @param id
     * @param status
     */
    int updateShortChange(@Param(value = "id") int id,@Param(value = "status") String status);

    /**
     * 派工日程安排页面：确定服务时间
     * @param id
     * @param status
     */
    int updateOverShortTime(@Param(value = "id") int id,@Param(value = "status") String status);

    int ChangeShortRecord(String ArrangeID);
    ArrangeInfo searchStaffRecord(String ArrangeID);


    /**
     * 搜索-派工信息页面
     * @param id
     * @param elderYbid
     * @param OrgSettleCode
     * @param servContentToString
     * @param arrange_time
     * @param status
     * @param servIDToString
     */
    int insertAllShort(@Param(value = "id") int id,
                       @Param(value = "elderYbid") String elderYbid,
                       @Param(value = "OrgSettleCode") String OrgSettleCode,
                       @Param(value="servContentToString")String servContentToString,
                       @Param(value="arrange_time")Date arrange_time,
                       @Param(value="status")String status,
                       @Param(value="servIDToString")String servIDToString);

    /**
     * 派工日程安排页面：确定服务时间
     * @param StartDate
     * @param StaffYbid
     * @param ArrangeID
     */
    int ServTimeChange(@Param(value = "StartDate") String StartDate,@Param(value = "StaffYbid") String StaffYbid, @Param(value = "ArrangeID") String ArrangeID);

    List<ArrangeInfo> searchStaffbyYbid(String StaffYbid);

    /**
     * 派工信息页面：获取老人服务日期
     * @param ArrangeID
     * @return
     */
    List<ArrangeInfo> getDateArrangeInfo(@Param(value="ArrangeID")String ArrangeID);
    /**
     * 派工信息页面：删除派工订单
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * 派工日程安排页面：根据ID查看是否已选择工作日
     * @param ArrangeID
     * @return
     */
    String findChosenDaybyID(@Param(value="ArrangeID")String ArrangeID);
    /**
     * 搜索-派工信息页面
     * @param servOrg
     * @param settleCode
     * @param servStatus
     * @param elderName
     * @param elderYbid
     * @param elderId
     * @param nursingName
     * @param nursingYbid
     * @param nursingId
     * @param startDate
     * @param dueDate
     * @param startTime
     */
    List<ArrangeInfo> findArrangeInfo(@Param(value = "servOrg") String servOrg , @Param(value="settleCode")String settleCode,
                                      @Param(value="servStatus")String servStatus, @Param(value = "elderName") String elderName ,
                                      @Param(value="elderYbid")String elderYbid, @Param(value="elderId")String elderId,
                                      @Param(value = "nursingName") String nursingName , @Param(value="nursingYbid")String nursingYbid,
                                      @Param(value="nursingId")String nursingId, @Param(value = "startDate") String startDate ,
                                      @Param(value="dueDate")String dueDate, @Param(value="startTime")String startTime);

    /**
     * 搜索-派工信息页面
     * @param elderYbid
     * @param OrgSettleCode
     * @param servContentToString
     * @param arrange_time
     * @param status
     * @param servIDToString
     */
    int insertArrangeInfo(@Param(value = "elderYbid") String elderYbid,
                          @Param(value = "OrgSettleCode") String OrgSettleCode,
                          @Param(value="servContentToString")String servContentToString,
                          @Param(value="arrange_time")Date arrange_time,
                          @Param(value="status")String status,
                          @Param(value="servIDToString")String servIDToString);

    /**
     * 增加服务项内容-派工信息页面
     * @param servContent
     * */
    int insertArrangeContents(@Param(value="servContent") List<String> servContent);

    /**
     * 派工日程安排页面：确定服务时间
     * @param StartDate
     * @param DueDate
     * @param StartTime
     * @param ServWorkLength
     * @param StaffYbid
     * @param ChosenWeekdayToString
     * @param ArrangeID
     * @param status
     * @param serv_status
     */
    int choseServTime(@Param(value="StartDate")String StartDate,@Param(value="DueDate")String DueDate,
                      @Param(value="StartTime")String StartTime,@Param(value="ServWorkLength")String ServWorkLength,
                      @Param(value="StaffYbid")String StaffYbid,@Param(value="ChosenWeekdayToString")String ChosenWeekdayToString,
                      @Param(value="ArrangeID")String ArrangeID,@Param(value="status")String status,@Param(value="serv_status")String serv_status);

    /**
     * 派工日程安排页面：确定服务时间
     * @param StartDate
     * @param DueDate
     * @param StartTime
     * @param ServWorkLength
     * @param StaffYbid
     * @param ChosenWeekdayToString
     * @param ArrangeID
     * @param status
     * @param serv_status
     */
    int choseServShortTime(@Param(value="StartDate")String StartDate,@Param(value="DueDate")String DueDate,
                      @Param(value="StartTime")String StartTime,@Param(value="ServWorkLength")String ServWorkLength,
                      @Param(value="StaffYbid")String StaffYbid,@Param(value="ChosenWeekdayToString")String ChosenWeekdayToString,
                      @Param(value="ArrangeID")String ArrangeID,@Param(value="status")String status,@Param(value="serv_status")String serv_status);

    /**
     * 派工日程安排页面：显示每天的服务时间
     * @param chosenDay
     * @param ArrangeID
     * */
    int insertEverydayTime(@Param(value="chosenDay")String chosenDay,@Param(value="ArrangeID")String ArrangeID);

    /**
     * 派工日程安排页面：显示每天的服务时间
     * @param chosenDay
     * @param ArrangeID
     * */
    int insertEverydayShortTime(@Param(value="chosenDay")String chosenDay,@Param(value="ArrangeID")String ArrangeID);

    /**
     * 派工日程安排页面：搜索护工的派工日程
     * @param NursingYbid
     * @param whichWeek
     * @return
     */
    List<ArrangeInfo> findNurseArrangement(@Param(value="NursingYbid")String NursingYbid,
                                           @Param(value="whichWeek")String whichWeek);

    /**
     * 派工信息页面：更新订单状态
     * @param Status
     * @param ArrangeInfoID
     * @return
     */
    int judgeStatus(@Param(value="Status")String Status,@Param(value="ArrangeInfoID")int ArrangeInfoID);

    /**
     * 派工信息页面：权限：查看派工单
     * @param settleCode
     * @return
     */
    List<ArrangeInfo> getAllArrangeInfobySettleCode(@Param(value="settleCode")String settleCode);


    /**
     * 派工信息页面：权限：查看派工单
     * @param settleCode
     * @return
     */
    List<ArrangeInfo> getAllArrangeShortInfobySettleCode(@Param(value="settleCode")String settleCode);

    /**
     * 派工单信息页面：权限：搜索当前机构下的派工信息
     * @param thisSettleCode
     * @param servOrg
     * @param servStatus
     * @param elderName
     * @param elderYbid
     * @param elderId
     * @param nursingName
     * @param nursingYbid
     * @param nursingId
     * @param startDate
     * @param dueDate
     * @param startTime
     * @return
     */
    List<ArrangeInfo> findArrangeInfobySettleCode(@Param(value="thisSettleCode")String thisSettleCode,@Param(value = "servOrg") String servOrg ,
                                                @Param(value="servStatus")String servStatus, @Param(value = "elderName") String elderName ,
                                                @Param(value="elderYbid")String elderYbid, @Param(value="elderId")String elderId,
                                                @Param(value = "nursingName") String nursingName , @Param(value="nursingYbid")String nursingYbid,
                                                @Param(value="nursingId")String nursingId, @Param(value = "startDate") String startDate ,
                                                @Param(value="dueDate")String dueDate, @Param(value="startTime")String startTime);


    /**
     * 微信小程序：老人页面：查询到护工的服务老人
     * @param StaffYbid
     * @return
     */
    List<ArrangeInfo> wechatElderBySatff(@Param(value="StaffYbid")String StaffYbid);

    /**
     * 微信小程序：老人页面：根据护工id查询到服务的老人
     * @return
     */
    List<ArrangeInfo> getMyelder(ArrangeInfo arrangeInfo);

    /**
     * 微信小程序：健康信息页面：查询到老人的服务内容
     * @param ArrangeID
     * @return
     */
    String wechatServIDByID(@Param(value="ArrangeID") String ArrangeID);



    /**
     * 微信小程序：健康信息页面：根据订单id找到老人YBID
     * @param ArrangeID
     * @return
     */
    String findElderYbidbyID(@Param(value="ArrangeID") String ArrangeID);

    /**

     * 根据HgId获取派工单
     * @param arrangeInfo
     * @return
     */
    List<ArrangeInfo> getArrangeByHgId(ArrangeInfo arrangeInfo);

    void InputExcel(Map<String,Map<String,Object>> param);

    /**
     * 派工页面：Excel文件上传后，将时间段信息补充完整
     */
    int CompleteInputExcel();

    /**
     * 派工日程安排页面：显示每天的服务时间
     * @param chosenDay
     * */
    int NewOrderEveryDayTime(@Param(value="chosenDay")String chosenDay);

    int NewOrderEveryDayTime();

    int getmaxID();

}
